<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>创建对象</title>
	</head>
	<body>
		<script>
			var person={
				name:'ybb',
				age:18,
				sayHi:function(){console.log("Hello JS!")}
			};
			console.log(person.name);
			console.log(person['age']);
			person.sayHi();
			
			var cat=new Object();
			cat.color='black';
			cat.name='Tom';
			cat.fun=function(){
				console.log("吃鱼");
			};
			console.log(cat.name);
			cat.fun();
		</script>
	</body>
</html>
